package fun.xinnix.controller;

import fun.xinnix.entity.JsonResult;
import fun.xinnix.publish.Producer;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/mq")
public class RabbitMqController {
    @Resource
    Producer producer;
    @PostMapping("/send")
    public String send(String name, String msg) {
        producer.send(name, msg);
        return "ok";
    }
}
